<div class="pageContent">
    <div class="panelBar">
        <ul class="toolBar">
            <if condition="in_array('insert', $privilegelist)">
                <li><a class="add" href="__URL__/add" rel="regionadd" target="dialog"><span>添加</span></a></li>
                <li class="line">line</li>
            </if>
            <if condition="in_array('edit', $privilegelist)">
                <li><a class="edit" href="__URL__/edit/id/{region_id}" rel="regionedit" target="dialog" warn="请选择一条记录"><span>修改</span></a></li>
            </if>
        </ul>
    </div>


    <table class="table" width="100%" layoutH="75">
        <thead>

            <tr>
            <if condition="in_array('delete', $privilegelist)">
            <th>
                <input type="checkbox" group="ids" class="checkboxCtrl" />
            </th>
            </if>
            <th>地区名称(点击地区名称查看下级地区)</th>
            <th>级别</th>
            <th>区号</th>
            <th>操作</th>
            </tr>
        </thead>
        <tbody>
        

        <volist name="list" id="region">
            <tr rel="{$region.region_id}" target="region_id">
                <if condition="in_array('delete', $privilegelist)">
                <td>
                    <input name="ids" value="{$region.region_id}" type="checkbox"/>
                </td>
                </if>
                <td>
                    <a href="javascript:void(0);" title="点击查看子级" onclick="$('tr[name^=chird_]').hide();$('tr[name^=chirdren_]').hide();$('tr[name=chird_{$region.region_id}]').show(100);">{$region.region_name}</a>
                </td>
                <td>
                    {$region.lv}
                </td>
                <td>
                    {$region.code}
                </td>
                <td>
                    <if condition="in_array('edit', $privilegelist)">
                    <a href="__URL__/edit/id/{$region.region_id}" target="dialog" class="btnEdit" rel="编辑">编辑</a>
                    </if>
                   
                    <if condition="in_array('delete', $privilegelist)">
 						<a title="删除" target="ajaxTodo" href="__URL__/delete/id/{$region.region_id}" class="btnDel">删除</a> 
                    </if>
                </td>
            </tr>
            
            <volist name="region.chirdren" id="chird" key="k">
                <tr rel="{$chird.region_id}" target="region_id" class="{$chird.region_id}" name="chird_{$region.region_id}" style="display:none;">
                    <if condition="in_array('delete', $privilegelist)">
                        <td>
                            <input name="ids" value="{$chird.region_id}" type="checkbox"/>
                        </td>
                    </if>
                    <td>
                        <a href="javascript:void(0);" title="点击查看子级" onclick="$('tr[name^=chirdren_]').hide();$('tr[name=chirdren_{$chird.region_id}]').show(100);">
                            >>> {$chird.region_name}
                        </a>
                    </td>
                    <td>
                        {$chird.lv}
                    </td>
                    <td>
                        {$chird.code}
                    </td>
                    <td>
                        <if condition="in_array('edit', $privilegelist)">
                            <a title="编辑" target="dialog" href="__URL__/edit/id/{$chird.region_id}" class="btnEdit">编辑</a>
                        </if>
                        <if condition="in_array('delete', $privilegelist)">
                            <a title="删除" target="ajaxTodo" href="__URL__/delete/id/{$chird.region_id}" class="btnDel">删除</a>
                        </if>
                	</td>
                </tr>
        

                <volist name="chird.chirdren" id="chirdren" key="k">
                    <tr rel="{$chirdren.region_id}" target="region_id" class="{$chirdren.region_id}" name="chirdren_{$chird.region_id}" style="display:none;">
                        <if condition="in_array('delete', $privilegelist)">
                            <td>
                                <input name="ids" value="{$chirdren.region_id}" type="checkbox"/>
                            </td>
                        </if>
                        <td>
                            >>>>>> {$chirdren.region_name}
                        </td>
                        <td>
                            {$chirdren.lv}
                        </td>
                        <td>
                            {$chirdren.code}
                        </td>
                        <td>
                            <if condition="in_array('edit', $privilegelist)">
                            <a title="编辑" target="dialog" href="__URL__/edit/id/{$chirdren.region_id}" class="btnEdit">编辑</a>
                            </if>
                            <if condition="in_array('delete', $privilegelist)">
                                <a title="删除" target="ajaxTodo" href="__URL__/delete/id/{$chirdren.region_id}" class="btnDel">删除</a>
                            </if>
                        </td>
                    </tr>
                </volist>
            </volist>
        </volist>
    </tbody>
    </table>
    <div class="panelBar">
        <div class="pages">
            <span>显示</span>
            <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
                <option value="20" <?php echo $numPerPage == 20 ? 'selected="true"' : '' ; ?> >20</option>
                <option value="50" <?php echo $numPerPage == 50 ? 'selected="true"' : '' ; ?>>50</option>
                <option value="100" <?php echo $numPerPage == 100 ? 'selected="true"' : '' ; ?> >100</option>
                <option value="200" <?php echo $numPerPage == 200 ? 'selected="true"' : '' ; ?> >200</option>
            </select>
            <span>条，共{$totalCount}条</span>
        </div>

        <div class="pagination" targetType="navTab" totalCount="{$totalCount}" numPerPage="{$numPerPage}" pageNumShown="10" currentPage="{$currentPage}"></div>

    </div>
</div>
